package state;

import main.Game;

import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Input;
import org.newdawn.slick.SlickException;

import button.Button;
import button.StandardButton;
import constans.Flag;
import constans.ResourceManager;

public class StartState extends State{

	//flag = Flag.PlayState;

	Button startButton;
	Button authorsButton;
	public StartState()
	{
		startButton = new StandardButton(100,123,100,50,Flag.damageButton,ResourceManager.getImage("play"),ResourceManager.getSound("click"));
		authorsButton = new StandardButton(140,203,100,50,Flag.damageButton,ResourceManager.getImage("author"),ResourceManager.getSound("click"));
		
	}
	
	public void render(GameContainer container, Graphics g) throws SlickException
	{	
		super.render(container, g);
		startButton.render(container, g);
		authorsButton.render(container, g);
	}
	public void update(GameContainer container, int delta) throws SlickException
	{	
		Input input = container.getInput();
		startButton.hover(input);
		if(startButton.click(input))
			Game.setState(Flag.playState, 0);
		
		authorsButton.hover(input);
		if(authorsButton.click(input))
			Game.setState(Flag.authorsState, 0);
	}

}
